package quick;

import java.util.Random;

public class Game {
    private Person person;
    public String  print(){
        StringBuffer buffer = new StringBuffer();
        Random random = new Random();
        for (int i = 0; i <LevelParam.lecels[person.getNum()-1].getChang(); i++) {//循环字符串
            int rand = random.nextInt(LevelParam.lecels[person.getNum()-1].getChang());
            switch (rand){
                        case 0:
                            buffer.append(".");
                            break;
                        case 1:
                            buffer.append(">");
                            break;
                        case 2:
                            buffer.append("<");
                            break;
                        case 3:
                            buffer.append("*");
                            break;
                        case 4:
                            buffer.append("-");
                            break;
                        case 5:
                            buffer.append("/");
                            break;
            }
        }
        System.out.println(buffer);
        return buffer.toString();
    }
    public Game(Person person) {
        this.person = person;
    }
    public void biJiao(String s1,String s2){
        long time = System.currentTimeMillis();     //当前时间
        if (s1.equals(s2)){
            if ((time-person.getStrTime())/1000<LevelParam.lecels[person.getNum()-1].getTime()){
                person.setScore(person.getScore()+LevelParam.lecels[person.getNum()-1].getScore());
                System.out.println("等级是:"+person.getNum()+"积分为:"+person.getScore()+"用时"+(time-person.getStrTime())/1000);
                if (person.getNum()==LevelParam.lecels.length){
                }
            }else {
                System.out.println("超时,游戏结束");
                System.exit(1);
            }
        }else {
            System.out.println("输入错误,退出程序");
            System.exit(1);
        }

    }
}
